38. CIFAR Classification Example

23 Cifar Class V1

model.eval()

There is an omission in the above code: including model.eval() !

model.eval( ) will set all the layers in your model to evaluation mode. This affects layers like dropout layers that turn "off" nodes during training with some probability, but should allow every node to be "on" for evaluation. So, you should set your model to evaluation mode before testing or validating your model and set it to model.train() (training mode) only during the training loop.

This is reflected in the following notebook code and in our Github repository .